<template>
    <div>
        <!-- 表格开始 -->
          <el-table :data="logs" style="width: 100%">
              <el-table-column   align="center" prop="realname" label="访问人真实姓名" width="180"></el-table-column>
              <el-table-column   align="center"  prop="method" label="访问方式" width="180"></el-table-column>
              <el-table-column   align="center" prop="content" label="访问路径"></el-table-column>
              <el-table-column   align="center" prop="logTime" label="访问时间"></el-table-column>
          </el-table>
          <!-- 表格结束 -->
          <!-- 分页开始 -->
          <div class="paginnation">
                <el-pagination
                layout="prev, pager, next"
                :page-size = 'list.pageSize'
                :total="total"
                @current-change='changeHandler'>
            </el-pagination>
    </div>
          <!-- 分页结束 -->
    </div>
</template>
<script>
import {mapState,mapActions} from 'vuex'
export default {
    data(){
        return{
         list:{
             page:1,
             pageSize:10
         },
        }
    },
    computed:{
        ...mapState('log',['logs','total'])
    },
    methods:{
        ...mapActions('log',['findAllLog']),
        changeHandler(page){
            this.list.page = page,
            this.findAllLog(this.list)
        },
    },
    created(){
        this.findAllLog(this.list)
    }
}
</script>
<style scoped>
.paginnation{
    float: right;
}
</style>